package com.dmtt.web.mapper;

import com.dmtt.web.are.entity.AgvCoordinate;
import com.dmtt.web.are.entity.AgvSuspend;
import com.dmtt.web.are.entity.AreSynchronized;
import com.dmtt.web.are.entity.AreSynchronizedHistory;
import com.dmtt.web.are.vo.CompanyVo;
import com.dmtt.web.entity.Agv;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author guzhenbiao
 * @project dmtt
 * @package com.dmtt.web.are.dao
 * @className AreSynchronizedMapper
 * @description TODO
 * @since2022/8/6 12:52
 * @version1.0
 */
@Mapper
@Repository
public interface AreSynchronizedMapper {

    /**
     * @Description: 区域锁列表加分页
     * @param:[areSynchronized, areSynchronized1, limit]
     * @return: java.util.List<com.dmtt.web.are.entity.AreSynchronized>
     * @Author: guzhenbiao
     * @Date: 2022-08-220 09:13:45
     */
    List<AreSynchronized> queryAreSynchronizedByPage(@Param("areSynchronized") AreSynchronized areSynchronized, @Param("currentStartIndex") Integer currentStartIndex, @Param("limit") Integer limit);

    /**
     * @Description: 区域锁列表总个数
     * @param:[areSynchronized, currentStartIndex, limit]
     * @return: int
     * @Author: guzhenbiao
     * @Date: 2022-08-220 15:23:12
     */
    Integer queryAreSynchronizedForCount(@Param("areSynchronized") AreSynchronized areSynchronized, @Param("currentStartIndex") Integer currentStartIndex, @Param("limit") Integer limit);

    /**
     * @Description: 新增区域锁数据
     * @param:[areSynchronized]
     * @return: java.lang.Long
     * @Author: guzhenbiao
     * @Date: 2022-08-218 15:50:24
     */
    Long insertAreSynchronized(AreSynchronized areSynchronized);

    /**
     * @Description: 删除坐标表数据
     * @param:[areSynchronizedId]
     * @return: void
     * @Author: guzhenbiao
     * @Date: 2022-08-218 15:50:30
     */
    void deleteAgvCoordinateByAreSynchronizedId(Long areSynchronizedId);

    /**
     * @Description: 新增坐标表数据
     * @param:[current]
     * @return: void
     * @Author: guzhenbiao
     * @Date: 2022-08-218 15:50:37
     */
    void insertAgvCoordinate(AgvCoordinate current);

    /**
     * @Description: 编辑区域锁数据
     * @param:[areSynchronized]
     * @return: void
     * @Author: guzhenbiao
     * @Date: 2022-08-218 16:12:19
     */
    void updateAreSynchronized(AreSynchronized areSynchronized);

    /**
     * @Description: 区域锁查看
     * @param:[id]
     * @return: com.dmtt.web.are.entity.AreSynchronized
     * @Author: guzhenbiao
     * @Date: 2022-08-218 16:36:17
     */
    AreSynchronized getAreSynchronizedById(String id);

    /**
     * @Description: 获取此区域下暂停的小车
     * @param:[]
     * @return: java.util.List<com.dmtt.web.are.entity.AgvCoordinate>
     * @Author: guzhenbiao
     * @Date: 2022-08-218 17:05:28
     */
    List<AgvSuspend> getAgvSuspendByAreSynchronizedIdAndStatus(@Param("areSynchronizedId") String areSynchronizedId, @Param("status") String status);

    /**
     * @Description: 禁用和启用
     * @param:[id, status]
     * @return: void
     * @Author: guzhenbiao
     * @Date: 2022-08-218 17:13:51
     */
    void updateAreSynchronizedForStatusById(@Param("id") String id, @Param("status") String status);

    /**
     * @Description: 获取所有企业的站点集合
     * @param:[areSynchronizedId]
     * @return: java.util.List<com.dmtt.web.are.entity.AgvCoordinate>
     * @Author: guzhenbiao
     * @Date: 2022-08-220 08:36:44
     */
    List<AgvCoordinate> getAgvCoordinateListByAreSynchronizedId(String areSynchronizedId);

    /**
     * @Description: 获取其他企业的站点
     * @param:[areSynchronizedId, company]
     * @return: java.util.List<com.dmtt.web.are.entity.AgvCoordinate>
     * @Author: guzhenbiao
     * @Date: 2022-08-224 17:34:41
     */
    AgvCoordinate getAgvCoordinateListByAreSynchronizedIdAndCompany(@Param("areSynchronizedId") String areSynchronizedId,@Param("company")String company);


    /**
     * @Description: 区域锁历史列表加分页
     * @param:[areSynchronizedHistory, currentStartIndex, limit]
     * @return: java.util.List<com.dmtt.web.are.entity.AreSynchronizedHistory>
     * @Author: guzhenbiao
     * @Date: 2022-08-220 15:55:54
     */
    List<AreSynchronizedHistory> queryAreSynchronizedHistoryByPage(@Param("areSynchronizedHistory") AreSynchronizedHistory areSynchronizedHistory);

    /**
     * @Description: 获取agv供应商集合
     * @param:[]
     * @return: java.util.List<com.dmtt.web.are.vo.CompanyVo>
     * @Author: guzhenbiao
     * @Date: 2022-08-227 09:20:07
     */
    List<CompanyVo> getAgvCompanyList();

}
